package com.dongpu.springboot.rabbitmq.config;

import com.dongpu.springboot.rabbitmq.pojo.Address;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author biyuyang
 *
 * 接受指定队列的消息
 *
 */
@Component
public class MQReceiver {

	@RabbitHandler
	@RabbitListener(queues = "addressupdatequeue")
	public void update(Address bo){
		System.out.println("MQReceiver update..."+bo.toString());
	}

	@RabbitHandler
	@RabbitListener(queues = "addressinsertqueue")
	public void insert(Address bo){
		System.out.println("MQReceiver insert..."+bo.toString());
	}

	@RabbitHandler
	@RabbitListener(queues = "addressdeletequeue")
	public void delete(Address bo){
		System.out.println("MQReceiver delete..."+bo.toString());
	}
}
